<?php
namespace Admin\Controller;

use Admin\Model\memberModel;

class CommonController extends BaseController
{

    public $memberModel;
    
    public function __construct() {
        parent::__construct();
        $this->memberModel = new memberModel();
    }
    
    public function index(){
        
    }
    /*
     * 通过AJAX发送过来的字段
     * 
     */
    public function matchmember(){
        $str = trim($_POST['str']);
        $type = checkStr($str);

            if($type == 2){//数字匹配手机号
                $where = array(
                    "mobile" => array("like",$str."%")
                );
            }
            elseif($type == 1){//汉子匹配姓名
                $where = array(
                    "realname" => array("like","%".$str."%")
                );
            }
            else{return false;}
           
            
            $list = $this->memberModel->where($where)->limit(0,10)->select();
            if($list){
                $this->ajaxReturn($list,"json");
            }else{
				return false;
			}
    
        
    }
    
    
    
}

?>